<template>
  <ve-wordcloud :data="chartData" height="100%" width="100%" :setting="chartSettings"></ve-wordcloud>
</template>

<script>
import CommonDataMixin from '../../mixins/commonDataMixin'
export default {
  mixins: [CommonDataMixin],
  watch: {
    wordCloud () {
      const data = []
      this.wordCloud.forEach((item, index) => {
        data.push({
          name: item.word,
          value: item.count
        })
      })
      this.chartData = {
        columns: ['name', 'value'],
        rows: data
      }
    }
  },
  data () {
    return {
      chartData: {},
      chartSettings: {
        color: ['rgba(97, 216, 0, .7)', 'rgba(204, 178, 26, .7)', 'rgba(245, 166, 35, .7)', 'rgba(156, 113, 113, .7)']
      }
    }
  }
}
</script>

<style>

</style>
